//
//  XTStatusBottomView.swift
//  HrenryWeibo
//
//  Created by 熊涛 on 16/5/18.
//  Copyright © 2016年 熊涛. All rights reserved.
//

import UIKit

class XTStatusBottomView: UIView {

    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }

    override init(frame: CGRect) {
        super.init(frame: frame)
        
        //添加控件
        prepareUI()
    }

    private func prepareUI() {
    
//        self.backgroundColor = UIColor.redColor()
        
        //添加子控件
        addSubview(retweetButton)
        addSubview(commentButton)
        addSubview(unlikeButton)
        
        //设置约束
        
        //转发
        retweetButton.snp_makeConstraints { (make) -> Void in
//            make.leading.equalTo(self)
//            make.top.equalTo(self)
//            make.bottom.equalTo(self)
            
            make.leading.top.bottom.equalTo(self)
        }
        
        //评论
        commentButton.snp_makeConstraints { (make) -> Void in
            make.leading.equalTo(retweetButton.snp_trailing)
//            make.top.equalTo(retweetButton)
//            make.width.equalTo(retweetButton)
//            make.bottom.equalTo(retweetButton)
            
            make.top.width.bottom.equalTo(retweetButton)
        }
        
        //点赞
        unlikeButton.snp_makeConstraints { (make) -> Void in
            make.leading.equalTo(commentButton.snp_trailing)
            make.trailing.equalTo(self)
//            make.top.equalTo(retweetButton)
//            make.bottom.equalTo(retweetButton)
//            make.width.equalTo(retweetButton)
            
            
            make.width.top.bottom.equalTo(retweetButton)
        }
        
    }
    
    
    
    //MARK: - 懒加载
    
    //转发
    private lazy var retweetButton : UIButton = UIButton(title: "转发", imageName: "timeline_icon_retweet")
    //评论
    private lazy var commentButton : UIButton = UIButton(title: "评论", imageName: "timeline_icon_comment")
    //点赞
    private lazy var unlikeButton : UIButton = UIButton(title: "赞", imageName: "timeline_icon_unlike")

}
